<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterTableActivitiesAddColumnLimitJoinNum extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('activities', function (Blueprint $table) {
            $table->unsignedBigInteger('limitJoinNum')->default(0)->comment('限制参与人数 0 - 不限制')->after('name');
            $table->unsignedBigInteger('hasJoinNum')->default(0)->comment('已参与人数')->after('limitJoinNum');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('activities', function (Blueprint $table) {
            $table->dropColumn('limitJoinNum');
            $table->dropColumn('hasJoinNum');
        });
    }
}
